
class Person{
    public String name;
    public int age;
    public static String sex;

    //静态代码块
    static {
        sex = "male";
    }

    //实例代码块
    {
        this.name = "小罗";
        this.age = 10;
    }


}

public class Test {
    public static void main(String[] args) {

        Person person = new Person();
    }
}
